package com.yangguang.huahui.mvp.presenter;

import com.yangguang.huahui.entity.Quotes;
import com.yangguang.huahui.mvp.model.ProblemModel;
import com.yangguang.huahui.mvp.view.QuotesListView;
import com.yangguang.huahui.rx.RxManager;
import com.yangguang.huahui.rx.RxSubscriber;

/**
 * Created by Administrator on 2017/3/20.
 */

public class QuotesListPresenter extends BasePresenter<QuotesListView>{
    ProblemModel model;

    public QuotesListPresenter() {
        model = new ProblemModel();
    }
    public void getList(int page){
        mSubscription = RxManager.getInstance().doSubscribe(model.getList(page), new RxSubscriber<Quotes>(false) {
            @Override
            protected void _onNext(Quotes quotes) {
                mView.onSuccess(quotes);
            }

            @Override
            protected void _onError() {
                mView.onError();
            }
        });
    }
}
